<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="wrap">
        <strong>抽奖</strong>
        <h1>一等奖：<span id="one">???</span></h1>
        <h2>二等奖：<span id="two">???</span></h2>
        <h3>三等奖：<span id="three">???</span></h3>
    </div>
    <script>
        const per = ['吃顿饭', '老干部', '俺是个']
        //一等奖
        const random = Math.floor(Math.random() * per.length)
        //获取one元素
        const one = document.querySelector('#one')
        one.innerHTML = per[random]
        per.splice(random, 1)

        //二等奖
        const random2 = Math.floor(Math.random() * per.length)
        const two = document.querySelector('#two')
        two.innerHTML = per[random2]
        per.splice(random2, 1)

        //sandengjiang
        const random3 = Math.floor(Math.random() * per.length)

        const three = document.querySelector('#three')
        three.innerHTML = per[random3]


    </script>
</body>

</html>